<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取 PHP</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="faq.mailinglist.html">« 邮件列表</a></li>
      <li style="float: right;"><a href="faq.databases.html">Database issues »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="faq.html">FAQ</a></li>
    <li>获取 PHP</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="faq.obtaining" class="chapter">
 <h1>获取 PHP</h1>

  

   <p class="para">
    本章包括 PHP 下载地址以及操作系统相关问题的详细资料。
   </p>

  <div class="qandaset"><ol class="qandaset_questions"><li><a href="#faq.obtaining.where">
     PHP 可以从哪里得到？
    </a></li><li><a href="#faq.obtaining.precompiled">
        有预先编译好的可执行版本吗？
      </a></li><li><a href="#faq.obtaining.optional">
     
      编译一些可选的 PHP 扩展库所需的库文件可以从哪里得到？
     
    </a></li><li><a href="#faq.obtaining.how">
        怎样使这些库起作用？
      </a></li><li><a href="#faq.obtaining.compilent">
     
     在我的 Windows 机器上通过 Git 仓库获取最新的 PHP 源码后，我应该如何去编译？
     
    </a></li><li><a href="#faq.obtaining.browscap">
     哪里可以找到 browscap.ini 文件？
    </a></li><li><a href="#faq.obtaining.threadsafety">
     下载 PHP 时线程安全是什么意思？
    </a></li></ol></div>
   <dl class="qandaentry" id="faq.obtaining.where">
    <dt><strong>
     PHP 可以从哪里得到？
    </strong></dt>
    <dd class="answer">
     <p class="para">
      可以从任何一个 PHP 网络成员的站点下载 PHP。这些信息在 <a href="https://www.php.net/" class="link external">&raquo;&nbsp;https://www.php.net/</a>。还可以通过匿名 Git 得到绝对是最新版的源程序。更多信息请访问 
      <a href="https://www.php.net/git.php" class="link external">&raquo;&nbsp;https://www.php.net/git.php</a>。
     </p>
    </dd>
   </dl>

    <dl class="qandaentry" id="faq.obtaining.precompiled">
      <dt><strong>
        有预先编译好的可执行版本吗？
      </strong></dt>
      <dd class="answer">
        <p class="para">我们只为 Windows 系统提供了预编译的可执行文件，因为我们没法为每个主流的 Linux/Unix 平台编译每一种扩展库组和的 PHP。同样注意，如今很多 Linux 的发行版本已经内置了 PHP。Windows 可执行文件可以从我们的
        <a href="https://www.php.net/downloads.php" class="link external">&raquo;&nbsp;下载</a>页面下载，至于 Linux 可执行文件，请访问你的 Linux 发布商的站点。</p>
      </dd>
    </dl>

   <dl class="qandaentry" id="faq.obtaining.optional">
    <dt><strong>
     
      编译一些可选的 PHP 扩展库所需的库文件可以从哪里得到？
     
    </strong></dt>
    <dd class="answer">
     <p class="para">
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <span class="simpara">
        有 * 号标记的都不是线程安全的；不建议在多线程环境中使用它们。 
       </span>
      </p></blockquote>
     </p>
     <p class="para">
      <ul class="itemizedlist">
       <li class="listitem">
        <span class="simpara">
                <a href="https://www.openldap.org/software/download/" class="link external">&raquo;&nbsp;LDAP (Unix)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
              <a href="https://wiki.mozilla.org/LDAP_C_SDK" class="link external">&raquo;&nbsp;LDAP (Unix/Win)</a>: Mozilla Directory (LDAP) SDK</span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.bind9.net/download-openldap/" class="link external">&raquo;&nbsp;免费 LDAP 服务器</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
              <a href="http://www.sleepycat.com/" class="link external">&raquo;&nbsp;Berkeley DB2 (Unix/Win)</a>: http://www.sleepycat.com/.</span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.net-snmp.org/" class="link external">&raquo;&nbsp;SNMP* (Unix):</a>
        </span>
       </li>
       <li class="listitem">
        <span class="simpara">
         <a href="http://www.libgd.org/" class="link external">&raquo;&nbsp;GD (Unix/Win)</a>。
        </span>
       </li>
       <li class="listitem">
        <span class="simpara">
                <a href="https://hughestech.com.au/products/msql/" class="link external">&raquo;&nbsp;mSQL* (Unix)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.postgresql.org/" class="link external">&raquo;&nbsp;PostgreSQL (Unix)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="https://github.com/uw-imap/imap" class="link external">&raquo;&nbsp;IMAP* (Win/Unix)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
              <a href="http://www.sybase.com/" class="link external">&raquo;&nbsp;Sybase-CT* (Linux, libc5)</a>：内置</span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.freetype.org/" class="link external">&raquo;&nbsp;FreeType (libttf):</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.zlib.net/" class="link external">&raquo;&nbsp;ZLib (Unix/Win32)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.jclark.com/xml/expat.html" class="link external">&raquo;&nbsp;expat XML parser (Unix/Win32)</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.pdflib.com/products/pdflib-family/" class="link external">&raquo;&nbsp;PDFLib</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://mcrypt.sourceforge.net/" class="link external">&raquo;&nbsp;mcrypt</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://mhash.sourceforge.net/" class="link external">&raquo;&nbsp;mhash</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://www.ibiblio.org/pub/Linux/libs/graphics/" class="link external">&raquo;&nbsp;t1lib</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://dmalloc.com/" class="link external">&raquo;&nbsp;dmalloc</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://aspell.net/" class="link external">&raquo;&nbsp;aspell</a>
              </span>
            </li>
            <li class="listitem">
              <span class="simpara">
                <a href="http://cnswww.cns.cwru.edu/~chet/readline/rltop.html" class="link external">&raquo;&nbsp;readline</a>
              </span>
            </li>
          </ul>
        </p>
      </dd>
    </dl>
    <dl class="qandaentry" id="faq.obtaining.how">
      <dt><strong>
        怎样使这些库起作用？
      </strong></dt>
      <dd class="answer">
        <p class="para">需要按照这些库提供的说明进行。一些库可以在运行 PHP 的“configure”时自动检测到（例如 GD 库），其它的必需用“
        <code class="literal">--with-EXTENSION</code>”选项来激活。运行“
        <code class="literal">configure --help</code>”来得到完整的列表。</p>
      </dd>
    </dl>
   <dl class="qandaentry" id="faq.obtaining.compilent">
    <dt><strong>
     
     在我的 Windows 机器上通过 Git 仓库获取最新的 PHP 源码后，我应该如何去编译？
     
    </strong></dt>
    <dd class="answer">
     <p class="para">
     参见 PHP Wiki 内的最新说明：<a href="https://wiki.php.net/internals/windows/stepbystepbuild" class="link external">&raquo;&nbsp;Step by Step Build Instructions</a>
    </p>
    </dd>
   </dl>
   <dl class="qandaentry" id="faq.obtaining.browscap">
    <dt><strong>
     哪里可以找到 browscap.ini 文件？
    </strong></dt>
    <dd class="answer">
     <p class="para">
      可以从 <a href="http://browscap.org/" class="link external">&raquo;&nbsp;http://browscap.org/</a> 得到一个 
      <var class="filename">browscap.ini</var> 文件。
     </p>
      </dd>
    </dl>
   <dl class="qandaentry" id="faq.obtaining.threadsafety">
    <dt><strong>
     下载 PHP 时线程安全是什么意思？
    </strong></dt>
    <dd class="answer">
     <p class="para">
      Thread Safety means that binary can work in a multithreaded webserver 
      context, such as Apache 2 on Windows. Thread Safety works by creating 
      a local storage copy in each thread, so that the data won&#039;t collide 
      with another thread.
     </p>
     <p class="para">
      So what do I choose? If you choose to run PHP as a CGI binary, then 
      you won&#039;t need thread safety, because the binary is invoked at each 
      request. For multithreaded webservers, such as IIS5 and IIS6, you should 
      use the threaded version of PHP.
     </p>
    </dd>
   </dl>
  
 </div>
</div></div></body></html>